import { Component } from '@angular/core';
import { MonitorBoardConfig } from 'src/components/scenarios/models';
import { MonitorBoardNode } from 'src/components/scenarios/nodes/MonitorBoardNode';
import { InfoSidebar } from '../../InfoSidebar';

@Component({
  selector: 'app-monitor-board-info',
  templateUrl: './monitor-board-info.component.html',
  styleUrl: './monitor-board-info.component.scss'
})
export class MonitorBoardInfoComponent implements InfoSidebar {
  sidebarRightVisible: boolean = false;
  cfg?: MonitorBoardConfig;
  item?: MonitorBoardNode;

  get status() {
    return this.item?.data.Values?.Status;
  }

  onShow(cfg: MonitorBoardConfig, item: MonitorBoardNode) {
    this.cfg = cfg;
    this.item = item;
    this.sidebarRightVisible = true;
  }

  onSidebarHide() {
    this.sidebarRightVisible = false;
    this.cfg = undefined;
    this.item;
  }
}
